package chp07;

import java.util.Arrays;

public class Test13 {

    public static void main(String[] args) {
        //数组插入内容
        String[] names = {"jack","tom","mike","peter","jim",null};
        System.out.println(Arrays.toString(names));
        //插入的算法
        // 把 小明 插入到 tom 的前面
        // 插入前的内容:      [jack, tom, mike, peter, jim, null]
        // 插入后的预期内容:  [jack, 小明, tom, mike, peter, jim]
        //手动
        names[5] = names[4];
        names[4] = names[3];
        names[3] = names[2];
        names[2] = names[1];
        System.out.println(Arrays.toString(names));
        names[1] = "小明";
        System.out.println(Arrays.toString(names));
    }
}
